﻿<?xml version="1.0" encoding="utf-8" ?>
<Feature id="PayPal" name="Paypal payment integration">
	<BusinessRules>
		<BusinessRule name="startPayPalExpressCheckout" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="completePayPalExpressCheckout" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="doPayPalDirectPayment" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalBizRules,ScsCore" />
			</Option>
		</BusinessRule>
	</BusinessRules>

	<BusinessRules>
		<BusinessRule name="getPayPalPaymentInfoPaymentDetails" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalEcomBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="updatePayPalPaymentInfoSalesOrderPayment" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalEcomBizRules,ScsCore" />
			</Option>
		</BusinessRule>

		<BusinessRule name="getPayPalCreditCardPaymentInfoPaymentDetails" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalEcomBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="updatePayPalCreditCardPaymentInfoSalesOrderPayment" security="disabled">
			<Option value="$PayPalRemoteTier$">
				<RemoteRule url="$PayPalRemoteTier$" />
				<LocalClass name="PayPal.PayPalEcomBizRules,ScsCore" />
			</Option>
		</BusinessRule>
	</BusinessRules>
	
	<BusinessRules>
		<BusinessRule name="getPayPalCompanySettingsTemplate" security="disabled" postExtends="getCompanySettingsDisplayTemplate">
			<LocalClass name="PayPal.PayPalTemplateBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="getPayPalCompanySettingsDbFields" security="disabled" postExtends="getCompanySettingsDbFields">
			<LocalClass name="PayPal.PayPalTemplateBizRules,ScsCore" />
		</BusinessRule>
	</BusinessRules>

	<BusinessObjects>
		<BusinessObject type="PayPalConfiguration">
			<Field name="allowExpressCheckout" type="Boolean" />
			<Field name="useSandbox" type="Boolean" />
			<Field name="userName" type="String" />
			<Field name="password" type="String" />
			<Field name="signature" type="String" />
		</BusinessObject>
		
		<BusinessObject injects="CompanySettings">
			<Field name="paypal" type="PayPalConfiguration"/>
		</BusinessObject>

		<BusinessObject type="PayPalError">
			<Field name="code" type="String" />
			<Field name="shortMessage" type="String" />
			<Field name="longMessage" type="String" />
		</BusinessObject>

		<BusinessObject type="PayPalRecurPaymentInteraction">
			<Field name="period" type="String" />
			<Field name="frequency" type="Integer" />
			<Field name="frequencyAmount" type="Currency" />
			<Field name="description" type="String" />
			<Field name="firstRecurringDate" type="String" />
			<Field name="orderItemId" type="Guid" />
		</BusinessObject>
		
		<BusinessObject type="PayPayInteraction">
			<Field name="token" type="String" />
			<Field name="payerId" type="String" />
			<Field name="payerStatus" type="String" />
			<Field name="firstNav" type="String" />
			<Field name="error" type="PayPalError" />
			<Field name="hasRecurring" type="Boolean" />
			<Field name="hasFullPay" type="Boolean" />
			<Field name="totalBillNow" type="String" />
			<Field name="recurPayments" type="List(PayPalRecurPaymentInteraction)" />
		</BusinessObject>

		<BusinessObject type="PayPalRecurringPaymentInfo">
			<Field name="profileId" type="String" />
			<Field name="status" type="String" />
			<Field name="correlationId" type="String" />
			<Field name="orderItemId" type="Guid" />
			<Field name="orderId" type="Guid" />
		</BusinessObject>
		
		<BusinessObject type="PayPalPaymentInfo" extends="eComPaymentTerm"  key="id">
			<Field name="paymentStatus" type="String" />
			<Field name="paymentType" type="String" />
			<Field name="orderTime" type="String" />
			<Field name="transactionId" type="String" />
			<Field name="transactionType" type="String" />
			<Field name="pendingReason" type="String" />
			<Field name="error" type="PayPalError" />
			<Field name="recurPayments" type="List(PayPalRecurringPaymentInfo)" />
		</BusinessObject>

		<BusinessObject type="PayPalCreditCardPaymentInfo" extends="eComCreditCardPaymentInfo"  key="id">
			<Field name="transactionId" type="String" />
			<Field name="avsCode" type="String" />
			<Field name="cvv2Match" type="String" />
			<Field name="error" type="PayPalError" />
			<Field name="recurPayments" type="List(PayPalRecurringPaymentInfo)" />
		</BusinessObject>

	</BusinessObjects>

	<ClassFactory id="BizProcs">
		<Class type="PayPal.Gui.PayPalExpressCheckoutBizProc,ScsCore" name="paypalExpress"/>
	</ClassFactory>
	
	<ClassFactory id="eComPaymentTermsDisplayTemplates">
		<Class name="PayPalPaymentInfo" mutable="false" type="System.String"><Default>PayPal.Gui.AspNet.PayPalPaymentInfoDisplay</Default></Class>
		<Class name="PayPalCreditCardPaymentInfo" mutable="false" type="System.String"><Default>eCom.Gui.AspNet.eComCreditCardPaymentInfoDisplay</Default></Class>
	</ClassFactory>
</Feature>